cmake_minimum_required(VERSION 3.16)

get_filename_component(ProjectId ${CMAKE_CURRENT_SOURCE_DIR} NAME)
string(REPLACE " " "_" ProjectId ${ProjectId})
project(C_Demo C)

set(CMAKE_C_STANDARD 11)
file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.c")
foreach (file ${files})
    message("file is: ${name} : ${file}")
    get_filename_component(name ${file} NAME)
    add_executable(${name} ${file})
endforeach ()